package com.dt.platform.hr.controller;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.dt.platform.domain.hr.PersonTransferAct;
import com.dt.platform.domain.hr.PersonTransferActVO;
import com.dt.platform.domain.hr.meta.PersonTransferActMeta;
import com.dt.platform.domain.hr.meta.PersonTransferActVOMeta;
import com.dt.platform.hr.service.IPersonTransferActService;
import com.dt.platform.proxy.hr.PersonTransferActServiceProxy;
import com.github.foxnic.api.error.ErrorDesc;
import com.github.foxnic.api.swagger.ApiParamSupport;
import com.github.foxnic.api.swagger.InDoc;
import com.github.foxnic.api.transter.Result;
import com.github.foxnic.commons.collection.CollectorUtil;
import com.github.foxnic.dao.data.PagedList;
import com.github.foxnic.dao.data.SaveMode;
import com.github.foxnic.dao.entity.ReferCause;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.github.foxnic.web.domain.hrm.Employee;
import org.github.foxnic.web.domain.hrm.Person;
import org.github.foxnic.web.framework.sentinel.SentinelExceptionUtil;
import org.github.foxnic.web.framework.web.SuperController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 员工调动记录接口控制器
 * </p>
 * @author 金杰 , maillank@qq.com
 * @since 2024-08-31 10:25:10
 */
@InDoc
@Api(tags = "员工调动记录")
@RestController("HrPersonTransferActController")
public class PersonTransferActController extends SuperController {

    @Autowired
    private IPersonTransferActService personTransferActService;

    /**
     * 添加员工调动记录
     */
    @ApiOperation(value = "添加员工调动记录")
    @ApiImplicitParams({
		@ApiImplicitParam(name = PersonTransferActVOMeta.CONTENT, value = "内容", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.FILE_IDS, value = "附件", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.ID, value = "主键", required = true, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.NOTE, value = "备注", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.OPER_TIME, value = "经办时间", required = false, dataTypeClass = Date.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.OPER_USER_ID, value = "经办人", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.STATUS, value = "办理状态", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.TRANSFER_DATE, value = "调动日期", required = false, dataTypeClass = Date.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.TRANSFER_TYPE, value = "调动方式", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.UPDATE_BY, value = "修改人ID", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.TO_ORG_POS, value = "调动部门", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.TO_ORG_POS_STATUS, value = "部门调整", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.TO_POS, value = "调动岗位", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.TO_POS_STATUS, value = "岗位调整", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.PERSON_ID, value = "调动人员", required = false, dataTypeClass = String.class, example = "808428146557714432")
	})
    @ApiParamSupport(ignoreDBTreatyProperties = true, ignoreDefaultVoProperties = true, ignorePrimaryKey = true)
    @ApiOperationSupport(order = 1, author = "金杰 , maillank@qq.com")
    @SentinelResource(value = PersonTransferActServiceProxy.INSERT, blockHandlerClass = { SentinelExceptionUtil.class }, blockHandler = SentinelExceptionUtil.HANDLER)
    @PostMapping(PersonTransferActServiceProxy.INSERT)
    public Result insert(PersonTransferActVO personTransferActVO) {
        Result result = personTransferActService.insert(personTransferActVO, false);
        return result;
    }

    /**
     * 操作确认
     */
    @ApiOperation(value = "确认")
    @ApiImplicitParams({
		@ApiImplicitParam(name = PersonTransferActVOMeta.ID, value = "主键", required = true, dataTypeClass = String.class, example = "1")
	})
    @ApiOperationSupport(order = 6, author = "金杰 , maillank@qq.com")
    @SentinelResource(value = PersonTransferActServiceProxy.CONFIRM, blockHandlerClass = { SentinelExceptionUtil.class }, blockHandler = SentinelExceptionUtil.HANDLER)
    @PostMapping(PersonTransferActServiceProxy.CONFIRM)
    public Result confirm(String id) {
        return personTransferActService.confirm(id);
    }

    /**
     * 删除员工调动记录
     */
    @ApiOperation(value = "删除员工调动记录")
    @ApiImplicitParams({
		@ApiImplicitParam(name = PersonTransferActVOMeta.ID, value = "主键", required = true, dataTypeClass = String.class)
	})
    @ApiOperationSupport(order = 2, author = "金杰 , maillank@qq.com")
    @SentinelResource(value = PersonTransferActServiceProxy.DELETE, blockHandlerClass = { SentinelExceptionUtil.class }, blockHandler = SentinelExceptionUtil.HANDLER)
    @PostMapping(PersonTransferActServiceProxy.DELETE)
    public Result deleteById(String id) {
        this.validator().asserts(id).require("缺少id值");
        if (this.validator().failure()) {
            return this.validator().getFirstResult();
        }
        // 引用校验
        ReferCause cause = personTransferActService.hasRefers(id);
        // 判断是否可以删除
        this.validator().asserts(cause.hasRefer()).requireEqual("不允许删除当前记录：" + cause.message(), false);
        if (this.validator().failure()) {
            return this.validator().getFirstResult().messageLevel4Confirm();
        }
        Result result = personTransferActService.deleteByIdLogical(id);
        return result;
    }

    /**
     * 批量删除员工调动记录 <br>
     * 联合主键时，请自行调整实现
     */
    @ApiOperation(value = "批量删除员工调动记录")
    @ApiImplicitParams({
		@ApiImplicitParam(name = PersonTransferActVOMeta.IDS, value = "主键清单", required = true, dataTypeClass = List.class, example = "[1,3,4]")
	})
    @ApiOperationSupport(order = 3, author = "金杰 , maillank@qq.com")
    @SentinelResource(value = PersonTransferActServiceProxy.DELETE_BY_IDS, blockHandlerClass = { SentinelExceptionUtil.class }, blockHandler = SentinelExceptionUtil.HANDLER)
    @PostMapping(PersonTransferActServiceProxy.DELETE_BY_IDS)
    public Result deleteByIds(List<String> ids) {
        // 参数校验
        this.validator().asserts(ids).require("缺少ids参数");
        if (this.validator().failure()) {
            return this.validator().getFirstResult();
        }
        // 查询引用
        Map<String, ReferCause> causeMap = personTransferActService.hasRefers(ids);
        // 收集可以删除的ID值
        List<String> canDeleteIds = new ArrayList<>();
        for (Map.Entry<String, ReferCause> e : causeMap.entrySet()) {
            if (!e.getValue().hasRefer()) {
                canDeleteIds.add(e.getKey());
            }
        }
        // 执行删除
        if (canDeleteIds.isEmpty()) {
            // 如果没有一行可以被删除
            return ErrorDesc.failure().message("无法删除您选中的数据行：").data(0).addErrors(CollectorUtil.collectArray(CollectorUtil.filter(causeMap.values(), (e) -> {
                return e.hasRefer();
            }), ReferCause::message, String.class)).messageLevel4Confirm();
        } else if (canDeleteIds.size() == ids.size()) {
            // 如果全部可以删除
            Result result = personTransferActService.deleteByIdsLogical(canDeleteIds);
            return result;
        } else if (canDeleteIds.size() > 0 && canDeleteIds.size() < ids.size()) {
            // 如果部分行可以删除
            Result result = personTransferActService.deleteByIdsLogical(canDeleteIds);
            if (result.failure()) {
                return result;
            } else {
                return ErrorDesc.success().message("已删除 " + canDeleteIds.size() + " 行，但另有 " + (ids.size() - canDeleteIds.size()) + " 行数据无法删除").data(canDeleteIds.size()).addErrors(CollectorUtil.collectArray(CollectorUtil.filter(causeMap.values(), (e) -> {
                    return e.hasRefer();
                }), ReferCause::message, String.class)).messageLevel4Confirm();
            }
        } else {
            // 理论上，这个分支不存在
            return ErrorDesc.success().message("数据删除未处理");
        }
    }

    /**
     * 更新员工调动记录
     */
    @ApiOperation(value = "更新员工调动记录")
    @ApiImplicitParams({
		@ApiImplicitParam(name = PersonTransferActVOMeta.CONTENT, value = "内容", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.FILE_IDS, value = "附件", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.ID, value = "主键", required = true, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.NOTE, value = "备注", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.OPER_TIME, value = "经办时间", required = false, dataTypeClass = Date.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.OPER_USER_ID, value = "经办人", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.STATUS, value = "办理状态", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.TRANSFER_DATE, value = "调动日期", required = false, dataTypeClass = Date.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.TRANSFER_TYPE, value = "调动方式", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.UPDATE_BY, value = "修改人ID", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.TO_ORG_POS, value = "调动部门", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.TO_ORG_POS_STATUS, value = "部门调整", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.TO_POS, value = "调动岗位", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.TO_POS_STATUS, value = "岗位调整", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.PERSON_ID, value = "调动人员", required = false, dataTypeClass = String.class, example = "808428146557714432")
	})
    @ApiParamSupport(ignoreDBTreatyProperties = true, ignoreDefaultVoProperties = true)
    @ApiOperationSupport(order = 4, author = "金杰 , maillank@qq.com", ignoreParameters = { PersonTransferActVOMeta.PAGE_INDEX, PersonTransferActVOMeta.PAGE_SIZE, PersonTransferActVOMeta.SEARCH_FIELD, PersonTransferActVOMeta.FUZZY_FIELD, PersonTransferActVOMeta.SEARCH_VALUE, PersonTransferActVOMeta.DIRTY_FIELDS, PersonTransferActVOMeta.SORT_FIELD, PersonTransferActVOMeta.SORT_TYPE, PersonTransferActVOMeta.DATA_ORIGIN, PersonTransferActVOMeta.QUERY_LOGIC, PersonTransferActVOMeta.REQUEST_ACTION, PersonTransferActVOMeta.IDS })
    @SentinelResource(value = PersonTransferActServiceProxy.UPDATE, blockHandlerClass = { SentinelExceptionUtil.class }, blockHandler = SentinelExceptionUtil.HANDLER)
    @PostMapping(PersonTransferActServiceProxy.UPDATE)
    public Result update(PersonTransferActVO personTransferActVO) {
        Result result = personTransferActService.update(personTransferActVO, SaveMode.DIRTY_OR_NOT_NULL_FIELDS, false);
        return result;
    }

    /**
     * 保存员工调动记录
     */
    @ApiOperation(value = "保存员工调动记录")
    @ApiImplicitParams({
		@ApiImplicitParam(name = PersonTransferActVOMeta.CONTENT, value = "内容", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.FILE_IDS, value = "附件", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.ID, value = "主键", required = true, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.NOTE, value = "备注", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.OPER_TIME, value = "经办时间", required = false, dataTypeClass = Date.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.OPER_USER_ID, value = "经办人", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.STATUS, value = "办理状态", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.TRANSFER_DATE, value = "调动日期", required = false, dataTypeClass = Date.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.TRANSFER_TYPE, value = "调动方式", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.UPDATE_BY, value = "修改人ID", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.TO_ORG_POS, value = "调动部门", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.TO_ORG_POS_STATUS, value = "部门调整", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.TO_POS, value = "调动岗位", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.TO_POS_STATUS, value = "岗位调整", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.PERSON_ID, value = "调动人员", required = false, dataTypeClass = String.class, example = "808428146557714432")
	})
    @ApiParamSupport(ignoreDBTreatyProperties = true, ignoreDefaultVoProperties = true)
    @ApiOperationSupport(order = 5, ignoreParameters = { PersonTransferActVOMeta.PAGE_INDEX, PersonTransferActVOMeta.PAGE_SIZE, PersonTransferActVOMeta.SEARCH_FIELD, PersonTransferActVOMeta.FUZZY_FIELD, PersonTransferActVOMeta.SEARCH_VALUE, PersonTransferActVOMeta.DIRTY_FIELDS, PersonTransferActVOMeta.SORT_FIELD, PersonTransferActVOMeta.SORT_TYPE, PersonTransferActVOMeta.DATA_ORIGIN, PersonTransferActVOMeta.QUERY_LOGIC, PersonTransferActVOMeta.REQUEST_ACTION, PersonTransferActVOMeta.IDS })
    @SentinelResource(value = PersonTransferActServiceProxy.SAVE, blockHandlerClass = { SentinelExceptionUtil.class }, blockHandler = SentinelExceptionUtil.HANDLER)
    @PostMapping(PersonTransferActServiceProxy.SAVE)
    public Result save(PersonTransferActVO personTransferActVO) {
        Result result = personTransferActService.save(personTransferActVO, SaveMode.DIRTY_OR_NOT_NULL_FIELDS, false);
        return result;
    }

    /**
     * 获取员工调动记录
     */
    @ApiOperation(value = "获取员工调动记录")
    @ApiImplicitParams({
		@ApiImplicitParam(name = PersonTransferActVOMeta.ID, value = "主键", required = true, dataTypeClass = String.class, example = "1")
	})
    @ApiOperationSupport(order = 6, author = "金杰 , maillank@qq.com")
    @SentinelResource(value = PersonTransferActServiceProxy.GET_BY_ID, blockHandlerClass = { SentinelExceptionUtil.class }, blockHandler = SentinelExceptionUtil.HANDLER)
    @PostMapping(PersonTransferActServiceProxy.GET_BY_ID)
    public Result<PersonTransferAct> getById(String id) {
        Result<PersonTransferAct> result = new Result<>();
        PersonTransferAct personTransferAct = personTransferActService.getById(id);
        // join 关联的对象
        personTransferActService.dao().fill(personTransferAct).with("oper").with(PersonTransferActMeta.PERSON).with(PersonTransferActMeta.TYPE_DICT).with(PersonTransferActMeta.ORG_POS).execute();
        personTransferActService.dao().join(personTransferAct.getOper(), Person.class);
        result.success(true).data(personTransferAct);
        return result;
    }

    /**
     * 批量获取员工调动记录 <br>
     * 联合主键时，请自行调整实现
     */
    @ApiOperation(value = "批量获取员工调动记录")
    @ApiImplicitParams({
		@ApiImplicitParam(name = PersonTransferActVOMeta.IDS, value = "主键清单", required = true, dataTypeClass = List.class, example = "[1,3,4]")
	})
    @ApiOperationSupport(order = 3, author = "金杰 , maillank@qq.com")
    @SentinelResource(value = PersonTransferActServiceProxy.GET_BY_IDS, blockHandlerClass = { SentinelExceptionUtil.class }, blockHandler = SentinelExceptionUtil.HANDLER)
    @PostMapping(PersonTransferActServiceProxy.GET_BY_IDS)
    public Result<List<PersonTransferAct>> getByIds(List<String> ids) {
        Result<List<PersonTransferAct>> result = new Result<>();
        List<PersonTransferAct> list = personTransferActService.queryListByIds(ids);
        result.success(true).data(list);
        return result;
    }

    /**
     * 查询员工调动记录
     */
    @ApiOperation(value = "查询员工调动记录")
    @ApiImplicitParams({
		@ApiImplicitParam(name = PersonTransferActVOMeta.CONTENT, value = "内容", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.FILE_IDS, value = "附件", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.ID, value = "主键", required = true, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.NOTE, value = "备注", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.OPER_TIME, value = "经办时间", required = false, dataTypeClass = Date.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.OPER_USER_ID, value = "经办人", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.STATUS, value = "办理状态", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.TRANSFER_DATE, value = "调动日期", required = false, dataTypeClass = Date.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.TRANSFER_TYPE, value = "调动方式", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.UPDATE_BY, value = "修改人ID", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.TO_ORG_POS, value = "调动部门", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.TO_ORG_POS_STATUS, value = "部门调整", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.TO_POS, value = "调动岗位", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.TO_POS_STATUS, value = "岗位调整", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.PERSON_ID, value = "调动人员", required = false, dataTypeClass = String.class, example = "808428146557714432")
	})
    @ApiOperationSupport(order = 5, author = "金杰 , maillank@qq.com", ignoreParameters = { PersonTransferActVOMeta.PAGE_INDEX, PersonTransferActVOMeta.PAGE_SIZE })
    @SentinelResource(value = PersonTransferActServiceProxy.QUERY_LIST, blockHandlerClass = { SentinelExceptionUtil.class }, blockHandler = SentinelExceptionUtil.HANDLER)
    @PostMapping(PersonTransferActServiceProxy.QUERY_LIST)
    public Result<List<PersonTransferAct>> queryList(PersonTransferActVO sample) {
        Result<List<PersonTransferAct>> result = new Result<>();
        List<PersonTransferAct> list = personTransferActService.queryList(sample);
        result.success(true).data(list);
        return result;
    }

    /**
     * 分页查询员工调动记录
     */
    @ApiOperation(value = "分页查询员工调动记录")
    @ApiImplicitParams({
		@ApiImplicitParam(name = PersonTransferActVOMeta.CONTENT, value = "内容", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.FILE_IDS, value = "附件", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.ID, value = "主键", required = true, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.NOTE, value = "备注", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.OPER_TIME, value = "经办时间", required = false, dataTypeClass = Date.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.OPER_USER_ID, value = "经办人", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.STATUS, value = "办理状态", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.TRANSFER_DATE, value = "调动日期", required = false, dataTypeClass = Date.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.TRANSFER_TYPE, value = "调动方式", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.UPDATE_BY, value = "修改人ID", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.TO_ORG_POS, value = "调动部门", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.TO_ORG_POS_STATUS, value = "部门调整", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.TO_POS, value = "调动岗位", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.TO_POS_STATUS, value = "岗位调整", required = false, dataTypeClass = String.class),
		@ApiImplicitParam(name = PersonTransferActVOMeta.PERSON_ID, value = "调动人员", required = false, dataTypeClass = String.class, example = "808428146557714432")
	})
    @ApiOperationSupport(order = 8, author = "金杰 , maillank@qq.com")
    @SentinelResource(value = PersonTransferActServiceProxy.QUERY_PAGED_LIST, blockHandlerClass = { SentinelExceptionUtil.class }, blockHandler = SentinelExceptionUtil.HANDLER)
    @PostMapping(PersonTransferActServiceProxy.QUERY_PAGED_LIST)
    public Result<PagedList<PersonTransferAct>> queryPagedList(PersonTransferActVO sample) {
        Result<PagedList<PersonTransferAct>> result = new Result<>();
        PagedList<PersonTransferAct> list = personTransferActService.queryPagedList(sample, sample.getPageSize(), sample.getPageIndex());
        // join 关联的对象
        personTransferActService.dao().fill(list).with("oper").with(PersonTransferActMeta.ORG).with(PersonTransferActMeta.ORG_POS).with(PersonTransferActMeta.PERSON).with(PersonTransferActMeta.TYPE_DICT).execute();
        List<Employee> operList = CollectorUtil.collectList(list, PersonTransferAct::getOper);
        personTransferActService.dao().join(operList, Person.class);
        result.success(true).data(list);
        return result;
    }
}
